<!DOCTYPE html>
<html>
<head>
<div th:include="base-libs :: base-libs" />
<script th:src="@{/tbxt/js/bbsh.js}"></script>
<title>基层月报-审核</title>

<meta name="content-type" content="text/html; charset=UTF-8">

	<style>
		body {
			background: #fff;
			overflow:hidden;
			text-align: center;
		}
		.laydate-icon{
		    line-height: 28px;
		    background-color: #fff;
		    height: 28px;
		    border: 1px solid #B6B6B6;
		    border-radius: 5px;
		    width:84% !important;
		}
		.titleTd{
			width:21%;
		}
	</style>

	<script>
		var bbshData = StoreCache.removeCache('bbshData');
		$(function(){
			$(this).registerManagerPage();
			initView();
			initData();
		})
		
		function initView(){
			$("input").attr("disabled",'disabled');
			
			//审核不通过
			$("body").on('click','#btnShbtg',function(){
				checkPass();
			});
			
			//审核通过
			$("body").on('click','#btnShtg',function(){
				checkNoPass();
			});
			
			//返回
			$("body").on('click','#btnFh',function(){
				//var SHYM = bbshData.SHYM;
				//var projectName = SHYM.replace(/^(\/[^\/]*).*/,'$1'); //通过正则表达式获取项目名称，如：/tbxt
				StoreCache.setCache('bbshTabIndex',1);
				$.QuickUrlUtils.redirectUrl("bbsh.html");
			});
			
			//审核记录
			$("body").on('click','#btnShjl',function(){
				StoreCache.setCache("BBID", bbshData.ID);
				openShjlView();
			});
		}
		
		function initData(){
			queryDataByNowDate();
		}
		
		/** 通过当前时间查询数据  */
		function queryDataByNowDate(){
			if(!$.isEmptyObject(bbshData)){
				var NFYF = bbshData.YF;
				var NF = NFYF.substring(0,4),
					YF = NFYF.substring(4);
				var queryParams = {
					YLJGID: bbshData.YLJGID,
					NF: NF,
					YF: YF
				}
				var NFYF = NF + '-' + YF;
				$.QuickRemote.AjaxJson(contextRoot + "jcyb/queryOne", queryDataByNowDateBack, queryParams, NFYF);
			}else{
				btnController();
			}
		}
		/** 通过当前时间查询数据--回调  */
		function queryDataByNowDateBack(result, NFYF){
			if(StringUtils.isEmpty(result.errInfo)){
				result.NFYF = NFYF;
				//按钮控制
				btnController(bbshData.ZT);
				
				var shztObj = {'0':'暂存','1':'待审核','2':'审核不通过','3':'审核通过'};
				result.ZTMC = shztObj[bbshData.ZT];
				
				$(".form-control").each(function(){
					var name = $(this).attr('name');
					$(this).val(result[name]).html(result[name]);
				})
				var NF = parseInt(result.NF) - 1 ;
				var queryParams = {YLJGID: bbshData.YLJGID,NF: NF,}
				$.QuickRemote.AjaxJson(contextRoot + "jcnb/queryNbInfo", function(re){
					//设置keyup事件，计算百分比
					var keyupParamArr = [
		                     ['QYZRS','x','QYL','',re.XQHJRKS],//签约率
		                     ['QYZDRQZS','x','ZDRQQYFGL','',re.ZDRQS],//重点人群签约覆盖率
		                     ['SZLYRC','SZRC','SZLYL'],//上转履约率
		                     ['ZRLYRC','ZRRC','ZRLYL'],//转入履约率
					];
					setKeyupFun(keyupParamArr);
				}, queryParams);
			}else{
				$.QuickAlert.alertFail({content: result.errInfo});
			}
		}
	</script>
</head>

<body class="easyui-layout">
<form id="myForm" action="save">
	<div region="north" style="height:60px;border:0;border-bottom:1px solid #ddd">
		<table class="form-table" style="margin-top:10px;">
			<tr>
				<td class="td-text">审核状态：</td>
				<td class="td-content">
					<input name="ZTMC" class="form-control" readonly="readonly"/>
				</td>
				<td class="td-text">机构名称：</td>
				<td class="td-content">
					<input name="JGMC" class="form-control" readonly="readonly"/>
				</td>
				<td class="td-text"><label>月份：</label></td>
				<td class="td-content">
					<input class="form-control laydate-icon" name="NFYF" onclick="WdatePicker({dateFmt:'yyyy-MM',onpicking:queryDataByNowDate})" 
						quick-config="label:'月份', validateProxy:'notNull'"/>
				</td>
				<td>
					<button id="btnShjl" class="btn btn-info" type="button">审核记录</button>
				</td>
			</tr>
		</table>
	</div>
	<div region="center" border="false">
		<div class="easyui-panel" title="一、家庭医生签约情况" border="false" style="width:100%">
			<table class="form-table">
				<tr>
					<td class="td-text titleTd">
						<label>1.家庭医生团队数：</label>
					</td>
					<td class="td-content">
						<input name="ID" class="form-control" type="hidden"/>
						<input name="JTYSTDS" class="form-control dataFiled" 
						 quick-config="label:'家庭医生团队数', validateProxy:'notNull length num', length: '10'" />
					</td>
					<td class="td-text titleTd"><label>2.团队家庭医生数：</label></td>
					<td class="td-content">
						<input name="TDJTYSS" class="form-control dataField" 
						quick-config="label:'团队家庭医生数', validateProxy:'notNull length num', length: '10'"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>3.团队护士数：</label></td>
					<td class="td-content">
						<input name="TDHSS" class="form-control" 
						quick-config="label:'团队护士数', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>4.团队多点执业医师数：</label></td>
					<td class="td-content">
						<input name="TDDDZYYSS" class="form-control" 
						quick-config="label:'团队多点执业医师数', validateProxy:'notNull length num', length: '10'"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>5.签约总人数</label>/本期新增签约人数：</td>
					<td class="td-content">
						<input id="QYZRS" name="QYZRS" class="form-control" style="width:40%;"
						quick-config="label:'签约总人数', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input name="BQXZQYRS" class="form-control" style="width:40%;"
						quick-config="label:'本期新增签约人数', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>6.签约率：</label></td>
					<td class="td-content">
						<input id="QYL" name="QYL" class="form-control" placeholder="签约总人数/辖区内户籍人口数"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>7.签约重点人群总数</label>/本期新增签约数：</td>
					<td class="td-content">
						<input  id="QYZDRQZS" name="QYZDRQZS" class="form-control" style="width:40%;" 
						quick-config="label:'签约重点人群总数', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input name="BQXZZDRQQYS" class="form-control" style="width:40%;" 
						quick-config="label:'本期新增签约数', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>8.重点人群签约覆盖率：</label></td>
					<td class="td-content">
						<input id="ZDRQQYFGL" name="ZDRQQYFGL" class="form-control" placeholder="重点人群签约总人数/辖区内重点人群数"/>
					</td>
				</tr>
			</table>
		</div>
		<div class="easyui-panel" title="二、慢病规范化管理情况" border="false" style="width:100%">
			<table class="form-table">
				<tr>
					<td class="td-text titleTd"><label>1.高血压患者规范管理数：</label></td>
					<td class="td-content">
						<input name="GXYHZGFGLS" class="form-control" type="text"
						quick-config="label:'高血压患者规范管理数', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text titleTd"><label>2.糖尿病患者规范管理数：</label></td>
					<td class="td-content">
						<input name="TNBHZGFGLS" class="form-control" 
						quick-config="label:'糖尿病患者规范管理数', validateProxy:'notNull length num', length: '10'"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>3.高血压签约患者规范管理数：</label></td>
					<td class="td-content">
						<input name="GXYQYHZGFGLS" class="form-control" 
						quick-config="label:'高血压签约患者规范管理数', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>4.糖尿病签约患者规范管理数：</label></td>
					<td class="td-content">
						<input name="TNBQYHZGFGLS" class="form-control" 
						quick-config="label:'糖尿病签约患者规范管理数', validateProxy:'notNull length num', length: '10'"/>
					</td>
				</tr>
			</table>
	
		</div>
	
		<div class="easyui-panel" title="三、就诊及转诊情况" border="false" style="width:100%">
			<table class="form-table">
				<tr>
					<td class="td-text titleTd"><label>1.就诊人次：</label></td>
					<td class="td-content">
						<input name="JZRC" class="form-control" 
						quick-config="label:'就诊人次', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text titleTd"><label>2.签约就诊人次：</label></td>
					<td class="td-content">
						<input name="QYJZRC" class="form-control" 
						quick-config="label:'签约就诊人次', validateProxy:'notNull length num', length: '10'"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>3.上转人次</label>/上转履约人次：</td>
					<td class="td-content">
						<input id="SZRC" name="SZRC" class="form-control" style="width:40%;" 
						quick-config="label:'上转人次', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input id="SZLYRC" name="SZLYRC" class="form-control" style="width:40%;" 
						quick-config="label:'上转履约人次', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>4.上转履约率：</label></td>
					<td class="td-content">
						<input id="SZLYL" name="SZLYL" class="form-control" placeholder="上转履约人次/上转人次"/>
					</td>
				</tr>
				<tr>
					<td class="td-text"><label>5.门诊上转人次</label>/门诊上转履约人次：</td>
					<td class="td-content">
						<input name="MZSZRC" class="form-control" style="width:40%;" 
						quick-config="label:'门诊上转人次', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input name="MZSZLYRC" class="form-control" style="width:40%;" 
						quick-config="label:'门诊上转履约人次', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>6.住院上转人次</label>/住院上转履约人次：</td>
					<td class="td-content">
						<input name="ZYSZRC" class="form-control" style="width:40%;" 
						quick-config="label:'住院上转人次', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input name="ZYSZLYRC" class="form-control" style="width:40%;" 
						quick-config="label:'住院上转履约人次', validateProxy:'notNull length num', length: '10'"/>
				</tr>
				<tr>
					<td class="td-text"><label>7.转入人次</label>/转入履约人次：</td>
					<td class="td-content">
						<input id="ZRRC" name="ZRRC" class="form-control" style="width:40%;" 
						quick-config="label:'转入人次', validateProxy:'notNull length num', length: '10'"/>
						
						<span style="display:inline-block;width:7.5%;text-align:center;">/</span>
						
						<input id="ZRLYRC" name="ZRLYRC" class="form-control" style="width:40%;" 
						quick-config="label:'转入履约人次', validateProxy:'notNull length num', length: '10'"/>
					</td>
					<td class="td-text"><label>8.转入履约率：</label></td>
					<td class="td-content">
						<input id="ZRLYL" name="ZRLYL" class="form-control" placeholder="转入履约人次/转入人次"/>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div region="south" id="south" style="height:45px;line-height:40px;text-align:center;border:0;border-top:1px solid #ddd">
	</div>
</form>

</body>
<script type="text/html" id="shBtnBox">
	<button id="btnShbtg" class="btn btn-info" type="button">审核不通过</button>
	<button id="btnShtg" class="btn btn-info" type="button">审核通过</button>
	<button id="btnFh" class="btn btn-info" type="button">返回</button>
</script>
</html>
